package com.vbes.cluster.module;

import com.google.android.gms.maps.model.LatLng;
import com.google.maps.android.clustering.ClusterItem;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * Created by Vbe on 2021/8/17.
 */
public class StationInfo implements ClusterItem {
    private int id;
    private String siteName;
    private LatLng latlng;
    private boolean available;
    private boolean upcoming;
    private boolean favorite;
    private boolean hasLabel;
    private Float zIndex;

    public StationInfo() {
        available = false;
        favorite = false;
        upcoming = false;
        hasLabel = false;
    }

    public StationInfo(LatLng l, String name, boolean a) {
        latlng = l;
        siteName = name;
        available = a;
        favorite = false;
    }

    public StationInfo(LatLng l, String name, boolean a, boolean f) {
        latlng = l;
        siteName = name;
        available = a;
        favorite = f;
    }

    public void setLatLng(double latitude, double longitude) {
        this.latlng = new LatLng(latitude, longitude);
    }

    public boolean isAvailable() {
        return available;
    }

    public boolean isUpcoming() {
        return upcoming;
    }

    public boolean isFavorite() {
        return favorite;
    }

    public int getId() {
        return id;
    }

    @NonNull
    @Override
    public LatLng getPosition() {
        return latlng;
    }

    @Nullable
    @Override
    public String getTitle() {
        return siteName;
    }

    @Nullable
    @Override
    public String getSnippet() {
        return null;
    }

    @Nullable
    @Override
    public Float getZIndex() {
        return zIndex != null ? zIndex : 1.0f;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public StationInfo setAvailable(boolean available) {
        this.available = available;
        return this;
    }

    public StationInfo setUpcoming(boolean upcoming) {
        this.upcoming = upcoming;
        return this;
    }

    public StationInfo setFavorite(boolean favorite) {
        this.favorite = favorite;
        return this;
    }

    public void setZIndex(Float zIndex) {
        this.zIndex = zIndex;
    }

    public boolean isHasLabel() {
        return hasLabel;
    }

    public StationInfo setHasLabel(boolean hasLabel) {
        this.hasLabel = hasLabel;
        return this;
    }
}
